import VueRouter from 'vue-router'

// 导入对应的路由组件
import HomeContainer from './components/tabber/HomeContainer.vue'
import MemberContainer from './components/tabber/MemberContainer.vue'
import ShoppingContainer from './components/tabber/ShoppingContainer.vue'
import SearchContainer from './components/tabber/SearchContainer.vue'

import NewsLink from './components/news/News.vue'
import NewsInfo from './components/news/NewsInfo.vue'
import PhotoList from './components/photo/photo.vue'
import PhotoInfo from './components/photo/PhotoInfo.vue'
import GoodsList from './components/goods/GoodsList.vue'
import GoodsInfo from './components/goods/GoodsInfo.vue'
import GoodsDisc from './components/goods/GoodsDisc.vue'
import GoodsComment from './components/goods/GoodsComment.vue'

// 创建路由对象
var router = new VueRouter({
  routes: [  // 配置路由规则
    { path: '/', redirect: '/home' },
    { path: '/home', component: HomeContainer },
    { path: '/member', component: MemberContainer },
    { path: '/shopping', component: ShoppingContainer },
    { path: '/search', component: SearchContainer },
    { path: '/home/newslink', component: NewsLink },
    { path: '/home/NewsInfo/:author', component: NewsInfo },
    { path: '/home/photoList', component: PhotoList },
    { path: '/home/photoinfo/:user', component: PhotoInfo },
    { path: '/home/GoodsList', component: GoodsList },
    { path: '/home/GoodsInfo/:id', component: GoodsInfo },
    // { path: '/home/GoodsInfo/:id', component: GoodsInfo, name: "goodsinfo" },
    { path: '/home/GoodsDisc/:id', component: GoodsDisc, name: "goodsdisc" },
    { path: '/home/GoodsComment/:id', component: GoodsComment, name: "goodscomment" }
  ],

  linkActiveClass: 'mui-active'   // 覆盖默认路由高亮的类，router-link-active
})

// 把路由对象暴露出去
export default router